﻿@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>首页-@WorkContext.StoreInfo.Name-@{@WorkContext.MallConfig.SiteTitle}</title>
    @Html.Raw(WorkContext.MallConfig.SEOKeyword)
    @Html.Raw(WorkContext.MallConfig.SEODescription)
    <link href="@{@WorkContext.CSSCDN}/css/base.css" rel="stylesheet" type="text/css" />
    <link href="@{@WorkContext.CSSCDN}/css/list.css" rel="stylesheet" type="text/css" />
    <script src="@{@WorkContext.ScriptCDN}/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        isGuestSC = @WorkContext.MallConfig.IsGuestSC;
        scSubmitType = @WorkContext.MallConfig.SCSubmitType;
    </script>
</head>

<body>

<div id="headerBar" class="bigBox">
<div class="box1210">
欢迎访问 @WorkContext.MallConfig.MallName
<div  class="headerLink">
    @if (WorkContext.Uid < 1)
    {
        <a href="@Url.Action("login", "account", new RouteValueDictionary { { "returnUrl", WorkContext.Url } })">[登录]</a>
        <a href="@Url.Action("register", "account")" class="A_b">[注册]</a>
    }
    else
    {
        @:您好: @WorkContext.NickName
        <a href="@Url.Action("logout", "account")">[退出]</a>
        if (WorkContext.PartUserInfo.StoreId > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "storeadmin" } })">[店铺管理]</a>
        }
        if (WorkContext.MallAGid > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "malladmin" } })">[商城管理]</a>
        }
        <a href="@Url.Action("orderlist", "ucenter")">[我的订单]</a>
    }
</div>
</div> 

</div>

<div id="header" class="bigBox">
<div class="box1210" id="header1">
<a href="/" class="logo left"><img src="@{@WorkContext.ImageCDN}/images/logo.jpg" /></a>
<div class="search left">
<div class="searchCon">
    <input type="text" id="keyword" name="keyword" class="Stext" autocomplete="off" onkeydown="javascript:if(event.keyCode==13) mallSearch(document.getElementById('keyword').value);" value="@WorkContext.SearchWord" />
    <input name="" type="button" value="搜索" class="Sbutton" onclick="mallSearch(document.getElementById('keyword').value)" />
<div class="clear"></div>
</div>

<div class="searchHot">热门搜索：
 @{
     List<AdvertInfo> searchWordAdvertList = Adverts.GetAdvertList(5);
     }
     @Html.Raw(searchWordAdvertList[0].Body)
 </div>

</div>


<div class="shopping right" onmousemove="getCartSnap()" id="cartSnapBox" onmouseout="closeCartSnap(event)">
<h2><a href="@Url.Action("index", "cart")">我的购物车<b id="cartSnapProudctCount">@WorkContext.CartProductCount</b></a></h2>
<div id="cartSnap" class="shoppingList" style=" display:none;"><div class="loding"><img src="@{@WorkContext.ImageCDN}/images/loading.gif" /><br />加载中，请稍候... </div></div>
</div>

<div class="clear"></div>
</div>
</div>

<div id="nav" class="bigBox">
<div class="box1210">
<!-- 分类导航 -->

<div id="categorys" onmouseover="document.getElementById('categorysCon').className=''" onmouseout="document.getElementById('categorysCon').className='hide'">
<h2>全部商品分类</h2>

<div id="categorysCon" class="hide">

@{
    List<NavInfo> navList = Navs.GetNavList();
    }
@{
    int layerFlag = 0;
    foreach (NavInfo info in navList)
    {
        if (info.Layer == 1)
        {
            if (layerFlag == 1)
            {
               @:</div></div>
            }
            @:<div class="item" onmouseover="this.className='item hotItem'" onmouseout="this.className='item'"><h3><a href="javascript:void(0)">@info.Name</a></h3><div class="itmeSon">
            layerFlag = 1;
        }
        else if (info.Layer == 2)
        {
            @:<dl><dt><a style="" href="javascript:void(0)">@info.Name</a></dt><dd>
            foreach (NavInfo nav in navList.FindAll(x => x.Pid == info.Id))
            {
                 @:<em><a style="" href="@nav.Url">@nav.Name</a></em>
            }
            @:</dd><div class="clear"></div></dl>
        }
    }
    @:</div></div>
}

</div>

</div>

<!-- 分类导航结束 -->

<ul id="navItme">
<li><a href="/">首页</a></li>
<li><a href="@Url.Action("category", "catalog", new RouteValueDictionary { { "cateId", 55 } })">电视专场</a></li>
<li><a href="@Url.Action("category", "catalog", new RouteValueDictionary { { "cateId", 65 } })">电脑专场</a></li>
<li><a href="@Url.Action("category", "catalog", new RouteValueDictionary { { "cateId", 71 } })">手机专场</a></li>
</ul>
</div>
</div>

@if (WorkContext.StoreInfo.Banner.Length > 0)
{
<div id="DPbanner" style="zoom:1; text-align:center; overflow:hidden;">
<a href="javascript:void(0)"><img src="@{@WorkContext.ImageCDN}/upload/store/@WorkContext.StoreId/banner/@WorkContext.StoreInfo.Banner" width="1920" height="500" /></a>
</div>
<script type="text/javascript">
    var storeBanner = document.getElementById("DPbanner");
    var bannerImg = storeBanner.getElementsByTagName("img")[0];
    var bodyW = document.body.offsetWidth;
    var imgW = bannerImg.offsetWidth;
    var imgH = bannerImg.offsetHeight;

    if (bodyW <= imgW) {
        storeBanner.style.width = bodyW + "px";
        storeBanner.style.height = imgH + "px";
        var aTag = storeBanner.getElementsByTagName("a")[0];
        aTag.style.position = "absolute";
        aTag.style.left = (-(imgW - bodyW) / 2) + "px";
    }
</script>
}

@{
    List<StoreClassInfo> storeClassList = Stores.GetStoreClassList(WorkContext.StoreId);
    }

<div class="box1210" id="DP">
<div id="listL">

<div id="DPserach">
<div class="DPtitle">本店搜索</div>
<div style="padding:0 10px 0 5px;"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="right">关键字</td>
    <td colspan="2"><input type="text" id="storeSearchKeyword" class="text" style="width:120px" /></td>
    </tr>
  <tr>
    <td align="right">价格</td>
    <td><input type="text" id="startPrice" class="text" style="width:30px; background:url(@{@WorkContext.ImageCDN}/images/m.jpg) no-repeat 3px center #FFF; padding-left:15px;" value="" /></td>
    <td><input type="text" id="endPrice" class="text" style="width:30px; background:url(@{@WorkContext.ImageCDN}/images/m.jpg) no-repeat 3px center #FFF; padding-left:15px;" value="" /></td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td colspan="2"><a href="javascript:void(0)" onclick="storeSearch(@WorkContext.StoreId, document.getElementById('storeSearchKeyword').value,0,document.getElementById('startPrice').value,document.getElementById('endPrice').value)" class="grayBT">搜索</a></td>
    </tr>
</table></div>
</div>

<div id="sortlist" class="m">
  <div class="mt"><h2>家用电器</h2></div>
  <div class="mc">
  <div class="item hot"><h3><b></b>店铺分类</h3><ul>
    @foreach (StoreClassInfo info in storeClassList)
    {
      @:<li><a href="@Url.Action("class", new RouteValueDictionary { { "storeId", WorkContext.StoreId }, { "storeCid", info.StoreCid } })">@info.Name</a></li>
    }
    </ul></div>
  </div>
</div>

</div>

<div id="listR">

<div class="proList">
<div class="DPtitle">店铺精品@*<a href="#" class="more">更多</a>*@</div>
<ul>
      @foreach (PartProductInfo info in Products.GetStoreTraitProductList(4, WorkContext.StoreInfo.StoreId, 0, 0))
      {
        <li><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", info.Pid } })"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg" width="100%" /><em>@info.Name</em></a><b>¥@info.ShopPrice</b>
        <div class="info"><div class="star"><span class="star_yellow" style=" width:@Html.Raw((info.GetStarLevel() * 20).ToString())%;">&nbsp;</span></div>
        <a href="#"> 已有 @info.ReviewCount 人评价</a> </div>
        <div class="info2"><span onclick="addProductToFavorite(@info.Pid)">加入收藏</span><a href="javascript:addProductToCart(@info.Pid, 1)" class="addShopping">加入购物车</a></div>
        </li>
      }
<div class="clear"></div>
</ul>
</div>

<div class="proList">
<div class="DPtitle">店铺热销@*<a href="#" class="more">更多</a>*@</div>
<ul>
      @foreach (PartProductInfo info in Products.GetStoreTraitProductList(4, WorkContext.StoreInfo.StoreId, 0, 1))
      {
        <li><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", info.Pid } })"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg" width="100%" /><em>@info.Name</em></a><b>¥@info.ShopPrice</b>
        <div class="info"><div class="star"><span class="star_yellow" style=" width:@Html.Raw((info.GetStarLevel() * 20).ToString())%;">&nbsp;</span></div>
        <a href="#"> 已有 @info.ReviewCount 人评价</a> </div>
        <div class="info2"><span onclick="addProductToFavorite(@info.Pid)">加入收藏</span><a href="javascript:addProductToCart(@info.Pid, 1)" class="addShopping">加入购物车</a></div>
        </li>
      }
<div class="clear"></div>
</ul>
</div>

<div class="proList">
<div class="DPtitle">店铺新品@*<a href="#" class="more">更多</a>*@</div>
<ul>
      @foreach (PartProductInfo info in Products.GetStoreTraitProductList(4, WorkContext.StoreInfo.StoreId, 0, 2))
      {
        <li><a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", info.Pid } })"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg" width="100%" /><em>@info.Name</em></a><b>¥@info.ShopPrice</b>
        <div class="info"><div class="star"><span class="star_yellow" style=" width:@Html.Raw((info.GetStarLevel() * 20).ToString())%;">&nbsp;</span></div>
        <a href="#"> 已有 @info.ReviewCount 人评价</a> </div>
        <div class="info2"><span onclick="addProductToFavorite(@info.Pid)">加入收藏</span><a href="javascript:addProductToCart(@info.Pid, 1)" class="addShopping">加入购物车</a></div>
        </li>
      }
<div class="clear"></div>
</ul>
</div>

</div>
<div class="clear"></div>
</div>


<div id="footer" class="bigBox">
  <div class="box1210">

    @{
        int flag = 1;
        foreach (HelpInfo info in WorkContext.HelpList)
        {
            if (info.Pid != 0)
            {
                if (info.Url.Length == 0)
                {
            <a href="@Url.Action("question", "help", new RouteValueDictionary { { "id", info.Id } })">@info.Title</a>
                }
                else
                {
            <a href="@info.Url">@info.Title</a>
                }
            }
            else
            {
                if (flag != 1)
                {
                @:</div>
            }
            @:<div class="footerBox"><h3>@info.Title</h3>
            flag++;
            }
        }
        if (WorkContext.HelpList.Count > 0)
        {
        @:</div>
    }
    }

  <div class="clear"></div>
  </div>
  <div class="bigBox footerB">
    <div id="footerB">
      <div class="links">
        @foreach (FriendLinkInfo info in WorkContext.FriendLinkList)
        {
        <a href="@info.Url" target="@info.Target" title="@info.Title">@info.Name</a> @:|
        }
      </div>
      <div>北京市公安局朝阳分局备案编号031143485246&nbsp;&nbsp;|&nbsp;&nbsp;京ICP证047722号&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" target="_blank">互联网药品信息服务资格证编号(京)-经营性-2012-0005</a>&nbsp;&nbsp;|&nbsp;&nbsp;新出发京零&nbsp;字第大145218号<br />石家庄蝶影软件开发有限公司 程序版本 @WorkContext.MallVersion 版权所有 @WorkContext.MallCopyright</div>
      <div><a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_jy.gif"></a> <a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_kx.gif"></a> <a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_wj.png"></a> <a href="#"><img width="112" height="40" src="@{@WorkContext.ImageCDN}/images/power_cx.png"></a></div>
    </div>
  </div>
</div>
@Html.Raw(WorkContext.ExecuteDetail)
@Html.Raw(WorkContext.MallConfig.Script)
</body>
</html>
